using System;
using System.Drawing;
using System.Drawing.Design;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
 

namespace CaveArt.UIcomp
{
	public class CheckBoxInPropertyGrid
	{
		bool _cb; 

		[Editor(typeof(CheckBoxInPropertyGridEditor),typeof(System.Drawing.Design.UITypeEditor))]
		public bool Cb
		{
			get{return _cb;}
			set{_cb=value;}
		}
	}
 

	public class CheckBoxInPropertyGridEditor : UITypeEditor
	{
		public override bool GetPaintValueSupported(ITypeDescriptorContext context)
		{
			return true;
		}


		public override void PaintValue(PaintValueEventArgs e)
		{
			ControlPaint.DrawCheckBox(e.Graphics,e.Bounds,((CheckBoxInPropertyGrid)e.Context.Instance).Cb ? ButtonState.Checked : ButtonState.Normal);
		}
	}
}